package com.jm.wf.data;

import com.jm.utils.Utils;
import com.jm.web.data.CrudDataEntity;

public class WFOpStep extends CrudDataEntity{

	public WFOpStep(Utils utils, String dataSource) {
		super(utils, dataSource, "wf..wf004", "sn");
	}
	
	public String getWFStepName(){
		return this.gpsv("wfstepname");
	}
	
	public String getWFInstanceID(){
		return this.gpsv("wf003sn");
	}
	
	public String getOpHrnum(){
		return  this.gpsv("ophrnum");
	}
	
	public String getOpChname(){
		return  this.gpsv("opchname");
	}
	
	public String getOpText(){
		return this.gpsv("optext");
	}
	
	public void setOpText(String optext){
		this.spsv("optext", optext);
	}
	
	public void setOpValue(String opvalue){
		this.spsv("opvalue", opvalue);
	}
	
	public String getOpValue(){
		return this.gpsv("opvalue");
	}
	
	public boolean isFinsh(){
		return "1".equals(this.gpsv("isfinsh"));
	}
	
	public void setFinsh(boolean bFinsh){
		this.spsv("isfinsh", bFinsh ? "1" : "0");
	}
	
	public int resetOp() throws Exception{
		this.setOpText("");
		this.setOpValue("");
		this.spsv("opday", "");
		this.setFinsh(false);
		return this.update("optext,opvalue,opday,isfinsh,"+this.getUpdateCols());
	}
}
